home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0897 / 000120_amos-request@svcs1.digex.net_Sat Aug 9 04:18:20 1997.msg < prev    next >
Text File  |  1997-09-09  |  5KB  |  135 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id EAA15403
  3.     for <mcox@access.digex.net>; Sat, 9 Aug 1997 04:18:19 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id CAA00519
  6.     for amos-out; Sat, 9 Aug 1997 02:59:27 -0400 (EDT)
  7. Received: from mail2.access.digex.net (mail2.access.digex.net [205.197.247.3])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id CAA00516
  9.     for <amos-list@svcs1.digex.net>; Sat, 9 Aug 1997 02:59:26 -0400 (EDT)
  10. Received: from dfw-ix15.ix.netcom.com (dfw-ix15.ix.netcom.com [206.214.98.15])
  11.     by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id CAA10439
  12.     for <amos-list@access.digex.net>; Sat, 9 Aug 1997 02:59:15 -0400 (EDT)
  13. Received: (from smap@localhost)
  14.           by dfw-ix15.ix.netcom.com (8.8.4/8.8.4)
  15.       id BAA22988 for <amos-list@access.digex.net>; Sat, 9 Aug 1997 01:58:42 -0500 (CDT)
  16. Received: from pit-pa1-04.ix.netcom.com(199.183.195.36) by dfw-ix15.ix.netcom.com via smap (V1.3)
  17.     id sma022974; Sat Aug  9 01:58:12 1997
  18. From: Garfield Benjamin <gbenjam@ix.netcom.com>
  19. Reply-To: Garfield Benjamin <gbenjam@ix.netcom.com>
  20. To: amos-list@access.digex.net
  21. Date: Sat, 09 Aug 1997 02:27:57 +0500
  22. Message-ID: <yam7160.2835.2797520@smtp.ix.netcom.com>
  23. X-Mailer: YAM 1.3.2 - Amiga Mailer by Marcel Beck
  24. Subject: Re: Bullfrog games
  25. MIME-Version: 1.0
  26. Content-Type: text/plain
  27. Status: O
  28. X-Status: 
  29.  
  30. On 09-Aug-97, --==Murray==-- wrote:
  31. >This is something I'd wondered about for ages.
  32.  
  33. >With games like Syndicate and Powermonger (and even Populus)
  34. >they all have around 100 people doing reasonably intelligent
  35. >stuff. I have no troubles getting 8 very intelligent things or 20 
  36. >reasonably intelligent things, but 100 or more?
  37.  
  38. >Obviously the assembly programming helps alot but is it really
  39. >that much?
  40.  
  41.    Yes, don't let people fool you... it is MUCH faster than AMOS code.
  42.    While you are processing 8 VI objects in AMOS, you could be
  43.    processing 40 VI objects or more (depending on how optimized
  44.    your original AMOS code, with the 8 objects, was)...
  45.  
  46.  
  47. >Does anyone know the secrets of this sort of thing?
  48.  
  49.    However, every language has it's limit... so, what they do is use
  50.    a kind of priority-processing method (I would assume)...
  51.  
  52.    Say you have those 100 objects scattered around a fairly large
  53.    area (multiple screens in size)...
  54.  
  55.    Your first priority is to update the objects which are currently
  56.    visible. These are updated every frame.
  57.  
  58.    Your second priority would be to update the IMPORTANT
  59.    non-visible objects. Say you decide to process five of these per
  60.    frame. 
  61.  
  62.    Finally, you process everything else, only one of these, less
  63.    important non-visible objects, per frame should be sufficient.
  64.  
  65.  
  66.    It would be easier if AMOS supported Lists, but it doesn't, so
  67.    you could just similate them, which thankfully is quite easy,
  68.    although quite messy as well!
  69.  
  70.    Just set up three array-types, for example...
  71.  
  72.    VISIBLEOBJS()  would contain pointers to the Visible (on-screen)
  73.    objects.
  74.  
  75.    IMPORTANTOBJS() would contain pointers to the NON-visible, but
  76.    important objects (say an assassin tracking you down).
  77.  
  78.    OTHEROBJS would contain pointers to the remaining objects.
  79.  
  80.    VISIBLEOBJS are updated every frame.
  81.    Five of the IMPORTANTOBJS are processed each frame.
  82.    One of the OTHEROBJS is processed each frame.
  83.  
  84.  
  85.    Basically, you just transfer the pointers around, through each of
  86.    the three ARRAY-TYPES, as the game progresses.
  87.  
  88.    For example if IMPORTANTOBJS(1) moves on-screen, it is
  89.    "removed" from IMPORTANTOBJS() and added to VISIBLEOBJS().
  90.  
  91.    Oh, of course you need the actual MASTEROBJECT arrays which
  92.    tell the details for every Object: postion, image, current action,
  93.    etc.
  94.  
  95.    The other three arrays just contain a Pointer to this MASTEROBJS
  96.    array.
  97.  
  98.    So, you'd retrieve the object-number from say OTHEROBJS(1) 
  99.    and say it is 5. This tells you that the actual OBJECT you are
  100.    processing is object-number 5 in the MASTEROBJECT arrays...
  101.  
  102.    Or, a simpler (but more memory-intensive) method, rather than
  103.    removing/adding entries ala Dynamic linked-list style, would be
  104.    to Define the three TYPE-ARRAYS with 100 elements each. Then
  105.    just loop through all 100 of the VISIBLEOBJS each frame and 
  106.    process every VISIBLEOBJ() that is non-zero as Object loop#.
  107.  
  108.    Same applies for OTHEROBJS and IMPORTANTOBJS, just loop for
  109.    five reps on OTHEROBJS, if non-zero, process OBJECT loop#.
  110.  
  111.    This way, all you have to do, to transfer Objects between the
  112.    three ARRAY-TYPES, is simply zero out the old ARRAY-TYPE and
  113.    Set the New ARRAY-TYPE, for the Object in question, as in:
  114.  
  115.    IMPORTANTOBJS(1)=False : VISIBLEOBJS(1)=True 
  116.    This IMPORTANT, non-visible object just entered the visible
  117.    playfield...
  118.  
  119.  
  120.    Anyway, it would be MUCH easier with structures and lists, but
  121.    anything can be done if you just go to the fundamentals...
  122.  
  123.  
  124.    Hope it helps.
  125.  
  126.  
  127.  
  128.       Take Care,
  129.  
  130.        GARFIELD
  131.  
  132.  
  133.  
  134.  
  135.